from django.contrib import admin
from .models import UIPage
from .models import UIElement
from .models import BusinessProcessTestingTasks

# Register your models here.


# def start_to_run_business_process_task(modeladmin, request, queryset):
#     start_to_run_business_process_task.short_description = "Run the interFace businessProcessTask testCases selected."
#     pass


class UIPageAdmin(admin.ModelAdmin):
    list_display = ['id', 'page_name', 'page_path', 'system_name', 'update_time']
    search_fields = ('id', 'page_name', 'page_path', 'system_name', 'update_time')
    ordering = ['create_time']
    list_display_links = ('id', 'page_name', 'page_path')
    # actions = [start_to_run_business_process_task]


class UIElementAdmin(admin.ModelAdmin):
    list_display = ['id', 'element_name', 'update_time']
    search_fields = ('id', 'page', 'element_name', 'update_time')
    ordering = ['create_time']
    list_display_links = ('id', 'element_name')
    # actions = [start_to_run_business_process_task]


class BusinessProcessTestingTasksAdmin(admin.ModelAdmin):
    list_display = ['id', 'businessProcessName', 'update_time']
    search_fields = ('id', 'businessProcessName', 'update_time')
    ordering = ['create_time']
    list_display_links = ('id', 'businessProcessName')
    # actions = [start_to_run_business_process_task]


admin.site.register(UIPage, UIPageAdmin)
admin.site.register(UIElement, UIElementAdmin)
admin.site.register(BusinessProcessTestingTasks, BusinessProcessTestingTasksAdmin)
